<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp" %>
<title>修改部门信息</title>
</head>
<body>
<fieldset class="layui-elem-field" style="margin:20px; padding:15px;">
    <legend>信息维护--修改信息</legend>
     <form class="layui-form" lay-filter="formA" method="post"> 
         <hr class="layui-bg-blak"/>
         <div class="layui-form-item">
             <label class="layui-form-label">编号 <span class="required" style="color:red">*</span></label>
             <div class="layui-input-inline">
                 <input type="text" name="code" readonly class="layui-input" lay-verify="required" checked placeholder="请输入编号" >
             </div>
         </div><br />
         <div class="layui-form-item">
             <label class="layui-form-label">名称  <span class="required" style="color:red">*</span></label>
             <div class="layui-input-inline">
                 <input type="text" name="name" class="layui-input" lay-verify="required" placeholder="请输入名称" required>
             </div>
         </div><br />
         <div class="layui-form-item">
             <div class="layui-input-block">
                 <input type="button" class="layui-btn" lay-submit lay-filter="upd" value="修改">
                 <input type="button" class="layui-btn" onclick="closeThis()" value="取消">
             </div>
         </div>
         <input type="hidden" name="action" value="upd">
     </form>
</fieldset>
<script type="text/javascript">
var code= '<%= request.getParameter("code")%>';
init();
function init(){
	ajax("/employee",{action:'get', code:code}, 'json', function(data){
// 		$("input[name='code']").val(data.code);
// 		$("input[name='name']").val(data.name);
// 		$("input[name='tel']").val(data.tel);
		form.val("formA",{code:data.code, name:data.name, tel:data.tel})
	})
}

formSubmit("/employee",'submit(upd)','text',function(data){
	if(1==data){
		layer.msg("修改成功", closeThis);
	}else{
		layer.msg("修改失败");
	}
});

</script>
</body>
</html>